package com.nike.amoeba.ui.act

import android.graphics.drawable.Drawable
import android.os.Bundle
import androidx.core.graphics.drawable.DrawableCompat
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import com.nike.amoeba.R
import com.nike.amoeba.base.BaseActivity
import com.nike.amoeba.databinding.ALoginBinding
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel


/**
 * @Author nike
 * @Date 2023/7/5 14:40
 * @Description
 */
class LoginAct: BaseActivity<BaseViewModel, ALoginBinding>() {

    lateinit var appBarConfiguration: AppBarConfiguration

    override fun initView(savedInstanceState: Bundle?) {
        setSupportActionBar(mDatabind.includeToolbar.toolbar)
        val navController = findNavController(R.id.nav_host_fragment)
        appBarConfiguration = AppBarConfiguration(navController.graph)
        setupActionBarWithNavController(navController, appBarConfiguration)
    }

    override fun onSupportNavigateUp(): Boolean {
        val navController = findNavController(R.id.nav_host_fragment)
        return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
    }

}